#include "pixmaps.h"
void* Pixmaps::_instance = nullptr; // 这个不能放.h   --  会造成重定义问题
                                    // 报错会提示在其他包含了这个.h文件中, 重定义了_instance
Pixmaps* Pixmaps::getInstance(){
    if(_instance == nullptr){
        // 加锁。。。懒得加了
        if(_instance == nullptr){
            _instance = new Pixmaps;
        }
    }
    return (Pixmaps*)_instance;
}

Pixmaps::Pixmaps()
    : map0("://image/map0.png")
    , map1("://image/map1.png")
    , map2("://image/map2.png")
    , map3("://image/map3.png")
    , map_src("://image/map_src.png")
    , map_dst("://image/map_dst.png")
{
    map0 = map0.scaled(map_width, map_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    map1 = map1.scaled(map_width, map_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    map2 = map2.scaled(map_width, map_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    map3 = map3.scaled(map_width, map_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    map_dst = map_dst.scaled(map_width, map_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    map_src = map_src.scaled(map_width, map_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}
